<?php
namespace App\Params\H5;
use App\Common\Constant;
use App\Params\Param;
/**
 * 客户登录参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class LoginParams extends Param
{
    public $mobile;
    public $scene;
    public $login_type = Constant::LOGIN_WAY_VCODE;
    public $sms_code;

    public function rules()
    {
        return [
            'mobile' => ['required', 'integer', 'regex:/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/'],
            'scene' => 'required|string',
            'login_type' => 'nullable|string',
            'sms_code' => 'nullable|integer',
        ];
    }

    /**
     * @return mixed
     */
    public function getSmsCode()
    {
        return $this->sms_code;
    }

    /**
     * @param mixed $sms_code
     */
    public function setSmsCode($sms_code): void
    {
        $this->sms_code = $sms_code;
    }

    /**
     * @return string
     */
    public function getLoginType(): string
    {
        return $this->login_type;
    }

    /**
     * @param string $login_type
     */
    public function setLoginType(string $login_type): void
    {
        $this->login_type = $login_type;
    }

    /**
     * @return mixed
     */
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * @param mixed $mobile
     */
    public function setMobile($mobile): void
    {
        $this->mobile = $mobile;
    }

    /**
     * @return mixed
     */
    public function getScene()
    {
        return $this->scene;
    }

    /**
     * @param mixed $scene
     */
    public function setScene($scene): void
    {
        $this->scene = $scene;
    }
}